package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-10-11
 * Time: 20:58
 */
public class Demo7 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            while (true) {
                // 在这里啥都不做

            }
        });

        System.out.println(t.getState());//NEW状态：还未开始工作

        t.start();

        Thread.sleep(1000);
        System.out.println(t.getState());//RUNNABLE状态：就绪状态
    }
}
